package com.boyinet.demo.pipelineleakage;

import com.boyinet.demo.pipelineleakage.service.SchedulerJobService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @author lengchunyun
 */
@SpringBootApplication
public class PipelineLeakageApplication implements CommandLineRunner {

    private final SchedulerJobService schedulerJobService;

    public PipelineLeakageApplication(SchedulerJobService schedulerJobService) {
        this.schedulerJobService = schedulerJobService;
    }

    public static void main(String[] args) {
        SpringApplication.run(PipelineLeakageApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        schedulerJobService.reloadJobs();
    }
}
